/*
 * CircleSlice.hpp
 *
 *  Created on: 05-01-2011
 *      Author: Piotr
 */

#pragma  once

#include "Vector.hpp"
#include "geometry/Rectangle.hpp"
#include "utils/MathUtils.hpp"

/*
 * A slice of a circle. It's represented by a circle center position, its radius and two angles in radians.
 * Angle is the angle of the center of a slice. The openingAngle is the part of the circle which is covered.
 */
class CircleSlice
{
	private:
		Vector position;
		float r;
		float angle;
		float openingAngle;

	public:
		explicit CircleSlice(const Vector& position = Vector(), float r = 1.0f, float angle = 0.0f,
				float openingAngle = MathUtils::PI);

		bool containsPartially(const geometry::Rectangle& rectangle) const;
		bool contains(const Vector& point) const;

		const Vector& getPosition() const;
		void setPosition(const Vector& position);
		float getRadius() const;
		void setRadius(float r);
		float getAngle() const;
		void setAngle(float angle);
		float getOpeningAngle() const;
		void setOpeningAngle(float openingAngle);
		float getMinAngleInRadians() const;
		float getMaxAngleInRadians() const;

		Vector getMinEndPoint() const;
		Vector getMaxEndPoint() const;
};
